﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta name="keywords" content="购物车"/>
    <meta name="description" content="购物车"/>
    <title>购物车</title>
    <link href="/static/index/css/swiper.3.2.0.min.css" type="text/css" rel="stylesheet"/>
    <link href="/static/index/css/base.css" type="text/css" rel="stylesheet"/>
    <link href="/static/index/css/ywtopbanner.css" type="text/css" rel="stylesheet"/>
    <link href="/static/index/css/ywbase.css" type="text/css" rel="stylesheet"/>

    <script src="/static/index/js/jquery.1.8.3.js" type="text/javascript"></script>
    <script src="/static/index/js/common.js" type="text/javascript"></script>
    <script src="/static/index/js/ywcart.js" type="text/javascript"></script>
    <script src="/static/index/js/jquery.superslide.2.1.1.js" type="text/javascript"></script>
    <script src="/static/index/js/base.js" type="text/javascript"></script>
    <script src="/static/index/js/vue.js"></script>
    <script src="/static/index/js/vuex.js"></script>
    <script src="/static/index/js/axios.js"></script>

    <!--[if lt IE 7]>
    <script type="text/javascript" src="/static/index/js/dd_belatedpng_0.0.8a-min.js"></script>
    <script type="text/javascript">
        // 解决ie6 下png透明问题设定需要渲染的DOM对象
        DD_belatedPNG.fix('.png_bg');
        //解决(让IE6缓存背景图片)
        document.execCommand("BackgroundImageCache", false, true);
    </script>
    <![endif]-->


</head>
<body>
<script language="javascript" type="text/javascript">
    NTKF_PARAM = {
        siteid: "kf_9707",		//企业ID，必填，取值参见文档开始表
        settingid: "kf_9707_1414986472014",		//缺省客服配置ID，必填，取值参见文档开始表
        uid: "",		//用户ID,未登录可以为空
        uname: "",		//用户名，未登录可以为空
        isvip: "",          //是否为vip用户
        userlevel: ""		//网站自定义会员级别
    } </script>

<div class="x-header">
    <div class="topNav-width topNav clearfix" >
        <div class="h-left tnLeft fl">
            <span>您好，欢迎光临特步官方商城！</span>
            {if condition="session('?username')"}
            <a href="javascript:location.href=''" class="x-login c-red"><b><?php echo session('username') ?></b></a>
            {else/}
            <a href="javascript:location.href='/index/user/login'" class="x-login c-red">请登录</a>
            {/if}

            <a href="/index/user/register" class="x-reg">免费注册</a>
            &nbsp;
            <input id="returnurl" value="" type="hidden"></input>
        </div>

        <dl class="tnRight">
            <dd>
                <h3><a href="{:url('index/personal/index')}"><b>0</b>我的特步<i class="my-icon"></i></a></h3>
                <ul>
                    <li><a >待支付 </a></li>
                    <li><a >待收货</a></li>
                    <li><a >待评价</a></li>
                    <li><a >站内信<i>0</i></a></li>
                </ul>
            </dd>
            <dd>
                <div class="iqr">
                    <div class="iqr-ctr"></div>
                </div>
            </dd>
            <dd>
                <h3>

                    <a target="_blank" class="" href="http://m.xtep.com.cn/"><i class="my-mobile"></i>手机特步
                        <i class="my-icon"></i></a>
                </h3>
                <ul>
                    <li>
                        <div class="iqr">
                            <div class="iqr-ctr">
                                <img src="/static/index/images/iqr.jpg" alt="">
                            </div>
                        </div>
                    </li>
                </ul>
            </dd>
            <dd>
                <h3><i class="shopcar"></i>
                    <a class="" target="_blank" href="/carts/">购物车<span class="c-red" id="topcart_info"></span>件</a>
                </h3>
            </dd>
            <li class="cart">
            </li>
        </dl><!-- tnLeft E -->
    </div>
</div>
<script>
    jQuery(".topNav").slide({
        type: "menu", //效果类型
        titCell: "dd", // 鼠标触发对象
        targetCell: "ul", // 效果对象，必须被titCell包含
        delayTime: 0, // 效果时间
        defaultPlay: false,  //默认不执行
        returnDefault: true // 返回默认
    });
</script>

<script language="javascript" type="text/javascript">
    NTKF_PARAM = {
        siteid: "kf_9707",		//企业ID，必填，取值参见文档开始表
        settingid: "kf_9707_1414986472014",		//缺省客服配置ID，必填，取值参见文档开始表
        uid: "",		//用户ID,未登录可以为空
        uname: "",		//用户名，未登录可以为空
        isvip: "",          //是否为vip用户
        userlevel: "",	//网站自定义会员级别
        ntalkerparam: {　　　           //如果网站订单页填写页无商品信息，可以不传此项
            cartprice: "0.00",	//购物车总价
            items: [		//注意：详情页是item，这里是items
            ]
        }
    }
    var client = "Ctebu";//百分点帐号
    var bfd_user_id = "";     // 当前用户的user_id，即用户注册名的编号,string类型。没有注册或注册没登陆时为空即可。
    var bfd_productArr = new Array();//获取当前购物车中所有商品的sku_id，组成一个字符串数组: productArr   比如购物车里有3个商品为['123','111','222']
</script>

<div class="cart-area-header">
    <div class="x-wrap">
        <script>
        </script>

        <a href="/"><img src="/static/index/images/logo_1.png"></a>
        <p>
            <img alt="" src="/static/index/images/gwc1.jpg">
        </p>
    </div>
</div>
<div id="app">
    <bucart></bucart>


</div>

<div>
    <div class="x-wrap" >
        <div class="cart-ctr" id="cart_box">
            {if condition="session('cart') "}
            <div class="cart-box">
                <table class="cart-table">
                    <tbody>
                    <tr class="cart-hd">
                        <th width="75" style="text-align: left"><input type="checkbox" >
                        </th>
                        <th width="360">商品信息</th>
                        <th width="140">单价（元)</th>
                        <th width="150">数量</th>
                        <th width="140">小计（元）</th>
                        <th width="140">操作</th>
                    </tr>
                    {foreach $data['goods'] as $k=> $v }
                    <tr class="cart-item" sid="{$k}" >
                        <td style="text-align: left"><input type="checkbox" name="check"   ></td>
                        <td ><a href="{:url('index/goods/index',['id'=>$v['id']])}" class="item-pic"><img src="/{$v['options']['img']}"  ></a><a class="item-title" href="{:url('index/goods/index',['id'=>$v['id']])}" target="_blank" > {$v['name']}</a><p>颜色: {$v['options']['color']} 尺码: {$v['options']['size']}码</p></td>
                        <td class="item-price" >{$v['price']}</td>
                        <td><div class="item-amount"><a class="num_del">-</a><input type="text" class="import" value="{$v['num']}" ><a class="num_add">+</a ></div></td>
                        <td class="c-red xiaoji" >{$v['total']}</td>
                        <td> <a class="item-del" href="javascript:;" >删除</a></td>
                    </tr>
                    {/foreach}
                    </tbody>
                </table>
            </div>
            <div class="cart-amount-box">
                <table class="cart-table">
                    <tbody>
                    <tr class="cart-hd">
                        <th width="75" style="text-align: left"><a href="" onclick="" class="checkAll">全选</a></th>
                        <th width="360"><a href="" onclick="">删除选中的商品</a></th>
                        <th width="140"><a href="" onclick="" class="clearCar inlineBlock fl mt5 ml15 pl15 icon">清空购物车</a></th>

                    </tr>
                    <tr class="cart-item">
                        <td colspan="7" style="text-align: left" class="cart-toolbar"><a href="/" class="cart-shop" value="">继续购物</a>
                            <div>已选<span >{$data['total_rows']}</span>件商品 <b>商品总价（不含运费）： </b> <em ><span></span>¥ <span class="total">{$data['total_price']}</span></em><input id="sub" type="button"  class="cart-sum" value="去结算" ></div></td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
    {else/}
    <div class="x-wrap"  >
        <div class="cart-ctr" id="cart_box1">
            <div class="area-no-shop"><i></i> <b>您的购物车还是空的！</b> <a title="马上去购物" href="/">马上去购物</a>
            </div>
        </div>
    </div>
    {/if}
</div>

<script type="text/javascript">
    // 一定要在页面中调用，不能放到js里面
    /* 内层图片滚动切换 */
    jQuery(".slideGroup .slideBox").slide({
        mainCell: "ul",
        vis: 5,
        prevCell: ".sPrev",
        nextCell: ".sNext",
        effect: "leftLoop"
    });
    /* 外层tab切换 */
    jQuery(".slideGroup").slide({titCell: ".parHd li", mainCell: ".parBd"});
</script>
<script src="/static/index/layer/layer.js"></script>
<script>
$(document).ready(function(){
    var add,reduce,num,num_txt,xiaoji,price,total;
    add=$(".num_add");//添加数量
    reduce=$(".num_del");//减少数量
//    num=0;//数量初始值
//    num_txt=$(".import");//接受数量的文本框
//    xiaoji = $('.xiaoji');//小计
//    price= parseInt($('.item-price').text());//商品单价
    var price=0;
    total = $('.total')
    var zong=0;
    //var num_val=num_txt.val();//给文本框附上初始值

    /*添加数量的方法*/
    add.click(function(){
        var num = $(this).siblings('.import').val();
        num++;
        $(this).siblings('.import').val(num)
        price = parseInt($(this).parents('td').siblings('.item-price').text());


        $(this).parents('td').siblings('.xiaoji').text(num * price);
        var cc=0;
        $('.xiaoji').each(function () {
           cc+= parseInt($(this).text())
        });
        total.text(cc)
        //ajax代码可以放这里传递到数据库实时改变总价
    });

    /*减少数量的方法*/
    reduce.click(function(){
        //如果文本框的值大于0才执行减去方法
        var num = $(this).siblings('.import').val();
//        if(num >0){
            //并且当文本框的值为1的时候，减去后文本框直接清空值，不显示0
            if(num == 1)
            {
                $(this).siblings('.import').val(1);
                layer.msg('客官,不要在点了, 都没了,还点~~~瞄~~~', function(){
                });
            }
            //否则就执行减减方法
            else
            {
                num = $(this).siblings('.import').val();
                num--;
                $(this).siblings('.import').val(num);
                price = parseInt($(this).parents('td').siblings('.item-price').text());


                $(this).parents('td').siblings('.xiaoji').text(num * price);


                var cc=0;
                $('.xiaoji').each(function () {
                    cc+= parseInt($(this).text())
                });
                total.text(cc)

            }

//        }
    });
    $("#sub").click(function () {
        var data = {
            id:$('.cart-item').attr('sid'),
            num:$('.import').val(),
//            price:$('.total').text()
        };
        $.post("{:url('index/cart/ajaxupdateCart')}",data,function(res){
            //添加完成购物车之后，跳转到购物车页面
            if (res =1){
                location.href = "{:url('index/order/index')}";
            }

        },'json')
    })


})
</script>
<div class="com-footer">
    <div class="footer-server">
        <div class="x-wrap">
            <dl>
                <dd>
                    <b>关于我们</b> <span><a  rel="nofollow"
                                         target="_blank">公司简介</a></span> <span><a rel="nofollow" target="_blank">联系我们</a></span>
                    <span><a  rel="nofollow" target="_blank">品牌加盟</a></span> <span><a  rel="nofollow" target="_blank">授权分销商</a></span></dd>
                <dd>
                    <b>购物指南</b> <span><a rel="nofollow"
                                         target="_blank">常见问题</a></span> <span><a rel="{:url('index/register/index')}" target="_blank">用户注册</a></span>
                    <span><a rel="nofollow"
                             target="_blank">购物流程</a></span> <span><a rel="nofollow" target="_blank">邮件订阅</a></span><span><a rel="nofollow" target="_blank">活动推荐</a></span></dd>
                <dd>
                    <b>售后服务</b> <span><a rel="nofollow" target="_blank">配送方式</a></span> <span><a rel="nofollow" target="_blank">防伪查询</a></span><span><a rel="nofollow" target="_blank">会员体系介绍</a></span></dd>
                <dd>
                    <b>支付方式</b> <span><a  rel="nofollow" target="_blank">支付宝</a></span> <span><a rel="nofollow" target="_blank">银联支付</a></span>
                    <span><a  rel="nofollow" target="_blank">发票制度</a></span>
                    <span><a  rel="nofollow" target="_blank">优惠券使用说明</a></span></dd>
            </dl>
            <div class="x-kf">
                <h3>400-720-1333</h3>
                <p>周一至周日 8:30-21:30</p>
                <a href="javascript:;" ></a>
                <p>周一至周日 9:00-23:00</p>
            </div>
        </div>
    </div>
    <div class="footer-img">
        <img alt="" src="/static/index/images/x-footer.jpg"/></div>
    <div class="footer-msg">
        <ul>
            <li>
                <a  target="_blank">关于特步</a></li>
            |
            <li>
                <a href="javascript:;" target="_blank">人才招聘</a></li>
            |
            <li>
                <a  target="_blank">特步新闻</a></li>
            |
            <li>
                <a  target="_blank">品牌合作</a></li>
            |
            <li>
                <a  target="_blank">帮助中心</a></li>
            |
            <li>
                <a >商城公告</a></li>
            |
            <li>
                <a  target="_blank">友情联接</a></li>
            |
            <li>
                <a >联系我们</a></li>
        </ul>
        <ul></ul>
        <p>
            特步跑鞋 Copyright 2011 xtep.com 特步运动服 All Rights Reserved 特步官方旗舰店 ICP：闽ICP备05021253号-1 特步官网专卖店
            <div style="width:300px;margin:0 auto; padding:20px 0 0 0;">
                <a target="_blank"
                   style="display:inline-block;text-decoration:none;height:20px;line-height:20px;"><img
                        src="/static/index/images/1234.png" style="float:left;"/>
        <p style="float:left;height:20px;line-height:20px;margin: 0px 0px 0px 5px; color:#939393;">闽公网安备
            35020302001628号</p></a>
    </div>

    </p>
</div>
<p class="footer-link">
    <img src="/static/index/images/t2hx54xfnaxxxxxxxx_!!405119695.gif"/> <a target="_blank"> <img src="/static/index/images/cert.png"/> </a>
    <a >
        <img alt="安全联盟认证" height="47" src="/static/index/images/sm_124x47.png" width="124"/> </a>
    <a  target="_blank"> <img
            alt="营业执照" height="auto" src="/static/index/images/ei_normal.png" width="auto"/> </a></p>
</body>